<?php
namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\Setting;
use Illuminate\Http\Request;

class CommonController extends Controller {

    /**
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * banner
     */
    public function banner(Request $request){
        $banner = Setting::whereSlug('banner')->first();
        $images = $banner? json_decode($banner->value, true) : [];
        $images = array_map(function ($item) {
            return config('app.url'). '/storage/' . $item;
        }, $images);
        return responseJson(200, '成功', $images);
    }
}
